package com.kamfu.bio.client;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.Socket;

/**
 * @program: kamfu
 * @ClassName BioClient1
 * @description:
 * @author: liandy
 * @create: 2021-12-30 11:11
 * @Version 1.0
 **/
public class BioClient1 {
    public static void main(String[] args) {
        try {
            //1.与服务端建立连接
            Socket socket=new Socket("localhost", 9000);
            //2.获取字节输出流
            OutputStream outputStream = socket.getOutputStream();
            //3.字节输出流转打印流
            PrintStream printStream=new PrintStream(outputStream);
            printStream.println("我是客户端A");
            printStream.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}